package com.nbsaas.boot.user.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户签到记录实体类
 * 
 * @author 系统生成
 */
@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "用户签到记录", model = "用户签到记录")
@Entity
@Table(name = "bs_user_sign_in")
@Comment("用户签到记录表")
public class UserSignIn extends AbstractEntity {

    @Comment("用户ID")
    @SearchItem(name = "userId", key = "userId", label = "用户ID")
    @FormField(title = "用户ID", sortNum = "1", grid = true, required = true)
    @Column(name = "user_id", nullable = false)
    private Long userId;

    @Comment("签到日期")
    @SearchItem(name = "signDate", key = "signDate", label = "签到日期")
    @FormField(title = "签到日期", sortNum = "2", type = InputType.date, grid = true, required = true)
    @Column(name = "sign_date", nullable = false)
    private Date signDate;

    @Comment("签到时间")
    @FormField(title = "签到时间", sortNum = "3", type = InputType.date, grid = true, required = true)
    @Column(name = "sign_time", nullable = false)
    private Date signTime;

    @Comment("签到类型")
    @FormField(title = "签到类型", sortNum = "4", grid = true, type = InputType.select)
    @Column(name = "sign_type", length = 20)
    private String signType; // NORMAL-普通签到, CONTINUOUS-连续签到, SPECIAL-特殊签到

    @Comment("签到状态")
    @FormField(title = "签到状态", sortNum = "5", grid = true, type = InputType.select)
    @Column(name = "sign_status", length = 20)
    private String signStatus; // SUCCESS-成功, FAILED-失败, CANCELLED-取消

    @Comment("奖励积分")
    @FormField(title = "奖励积分", sortNum = "6", grid = true, type = InputType.el_input_number)
    @Column(name = "reward_points", precision = 10, scale = 0)
    private Integer rewardPoints;

    @Comment("奖励金额")
    @FormField(title = "奖励金额", sortNum = "7", grid = true, type = InputType.el_input_number)
    @Column(name = "reward_amount", precision = 10, scale = 2)
    private BigDecimal rewardAmount;

    @Comment("连续签到天数")
    @FormField(title = "连续签到天数", sortNum = "8", grid = true, type = InputType.el_input_number)
    @Column(name = "continuous_days")
    private Integer continuousDays;

    @Comment("签到IP地址")
    @FormField(title = "签到IP地址", sortNum = "9", grid = true)
    @Column(name = "sign_ip", length = 50)
    private String signIp;

    @Comment("签到设备")
    @FormField(title = "签到设备", sortNum = "10", grid = true)
    @Column(name = "sign_device", length = 200)
    private String signDevice;

    @Comment("签到位置")
    @FormField(title = "签到位置", sortNum = "11", grid = true)
    @Column(name = "sign_location", length = 500)
    private String signLocation;

    @Comment("签到备注")
    @FormField(title = "签到备注", sortNum = "12", type = InputType.textarea)
    @Column(name = "sign_remark", length = 1000)
    private String signRemark;

    @Comment("是否补签")
    @FormField(title = "是否补签", sortNum = "13", grid = true, type = InputType.select)
    @Column(name = "is_makeup")
    private Boolean isMakeup;

    @Comment("补签日期")
    @FormField(title = "补签日期", sortNum = "14", type = InputType.date, grid = true)
    @Column(name = "makeup_date")
    private Date makeupDate;
} 